package com.woniu.dao;

import com.woniu.dto.DynamicDTO;
import com.woniu.pojo.Dynamic;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DynamicMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Dynamic record);

    int insertSelective(Dynamic record);

    Dynamic selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Dynamic record);

    int updateByPrimaryKey(Dynamic record);

    List<DynamicDTO> findDynamicByPage(Integer Page, Integer Size);

    DynamicDTO selectDetailById(@Param("dynamicId") Long id);
@Update("update dynamic set tag_num=#{num} where id=#{did}")
    void updateTagNums(@Param("did")Long dynamicId,@Param("num") Integer num);
    @Update("update dynamic set comments_num=#{num} where id=#{did}")
    void updateCommentNums(@Param("did")Long dynamicId, @Param("num")Integer commentNum);
@Select("select user_id from dynamic where id=#{id}")
    Long selectUserId(Long id);

    List<DynamicDTO> selectFriendBynamic(@Param("list") List<Long> friendsId);


}